﻿using CopyBaron.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CopyBaron
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var settings = CopyBaronSettings.CreateFromAppConfig();
            var copyBaron = new CopyBaron2(settings);
            try
            {
                copyBaron.CleanClipboard();
            }
            catch
            {

            }

            // Erst hier schließen, sonst rafft Windows 7 das geschlossene Fenster irgendwie
            // nicht und lässt den Task in der Taskleiste 2 Sekunden auf "an".
            Close();
        }
    }
}
